<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="邵铭">
    <title></title>
    <style>
        * {
            box-sizing: border-box;
        }
        
        body {
            margin: 0;
            padding: 0;
        }
        
        .head {
            margin: 0;
            padding: 0;
            list-style: none;
            display: flex;
        }
        
        .head>li {
            margin: 0 40px;
            width: 100px;
        }
        
        nav {
            height: 50px;
            background-color: #aaa;
        }
        
        .container {
            margin: 0 auto;
            width: 1000px;
        }
        
        a {
            text-decoration: none;
            color: black;
            font-size: 20px;
            line-height: 50px;
        }
        
        a:hover {
            /*color: orange;*/
        }
        
        .nav-sub {
            margin: 0;
            padding: 0;
            list-style: none;
            border: 1px solid #aaa;
            display: none;
        }
        
        .nav-sub>li {
            width: 100px;
            padding: 0 10px;
        }
        
        .nav-sub a {
            font-size: 15px;
        }
    </style>
</head>

<body>
    <nav>
        <div class="container">
            <ul class="head">
                <li>
                    <a href="#">公司简介</a>
                    <ul class="nav-sub">
                        <li><a href="#">概况介绍</a></li>
                        <li><a href="#">发展历史</a></li>
                        <li><a href="#">公司实力</a></li>
                    </ul>
                </li>
                <li>
                    <a href="#">产品介绍</a>
                    <ul class="nav-sub">
                        <li><a href="#">软件研发</a></li>
                        <li><a href="#">软件教育</a></li>
                        <li><a href="#">天使投资</a></li>
                    </ul>
                </li>
                <li>
                    <a href="#">联系我们</a>
                    <ul class="nav-sub">
                        <li><a href="#">公司地址</a></li>
                        <li><a href="#">联系方式</a></li>
                        <li><a href="#">投资加盟</a></li>
                    </ul>
                </li>
                <li>
                    <a href="#">人才招聘</a>
                    <ul class="nav-sub">
                        <li><a href="#">java招聘</a></li>
                        <li><a href="#">HTML招聘</a></li>
                        <li><a href="#">PHP招聘</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
    <script src="./jquery.js"></script>
</body>

</html>
<script>
    var head = $('.head');
    // var lis=$(head.children('li'));
    // var navSub=$('.nav-sub');
    // console.log($(head.children('li')));
    $(head.children('li')).each(function (index) {
        $(this).hover(function () {
            $('.nav-sub').eq(index).css('display', 'block');
        }, function () {
            $('.nav-sub').eq(index).css('display', 'none');
        });
    });

    $('a').each(function (index) {
        $(this).hover(function () {
            $('a').eq(index).css('color', 'orange');
           $('a').eq(index).css('text-decoration','underline');
        }, function () {
            $('a').eq(index).css('color', 'black');
            $('a').eq(index).css('text-decoration','none');
        });
    });


</script>